package com.powerhua.workflow.jbpm.template.impl;

import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;

import com.powerhua.workflow.jbpm.template.JbpmProcess;
import com.powerhua.workflow.jbpm.template.JbpmTemplate;


public class JbpmTemplateImpl implements JbpmTemplate{
	
	public void execute(JbpmProcess process) {
		JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
		JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
		try {
			process.doInJbpm(jbpmContext);
		} finally {
			jbpmContext.close();
		}
	}

}
